<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
        <meta charset="utf-8" />
        <meta name="description" content="对网页的一段概括性描述"/>
        <meta name="keywords" content="关键字1,关键字2,关键字3..."/>
        <meta name="renderer" content="webkit">
        <title>Hiring-企业注册</title>
        <%@ include file="/WEB-INF/view/common/import.jsp"%>
    </head>
<body>
<div class="container">
			<ol class="breadcrumb">
					<li><a href="<%=request.getContextPath()%>/PositionServlet?command=selectAllPosition&pageNo=1">首页</a></li>
					<li><a href="<%=request.getContextPath() %>/TalentServlet?command=toLoginUi">求职者登录</a></li>
					<li><a href="<%=request.getContextPath() %>/TalentServlet?command=toRegisterUi">求职者注册</a></li>
					<li class="active">Data</li>
			</ol>
</div>
<div  class="container">				
			<form class="form-signin" role="form" action="<%=request.getContextPath() %>/TalentServlet?command=register" method="post">
			
			<div class="input-group">
			  <span class="input-group-addon">帐号:</span>
			  <input  name="code" type="text" id="addcode" class="form-control" required onblur="selectCode(this)" ><br />
			</div>
			<div class="input-group">
			  <span class="input-group-addon">密码:</span>
			  <input  name="password" type="text" class="form-control" required><br />
			</div>
			<div class="input-group">
			  <span class="input-group-addon">姓名:</span>
			  <input name="name" type="text" class="form-control" required><br />
			</div>
			<div class="input-group">
			  <span class="input-group-addon">电话:</span>
			  <input name="phone" type="text" class="form-control" required><br />
			</div>
			<div class="input-group">
			  <span class="input-group-addon">邮箱:</span>
			  <input name="email" type="email" class="form-control" required><br />
			</div>
			<div class="input-group">
			  <span class="input-group-addon">年龄:</span>
			  <input name="age" type="text" class="form-control" required><br />
			</div>
			<div class="input-group">
			  <span class="input-group-addon  " >性别:</span>
			  <div class="form-control"  >
			   <label>
			  <input type="radio"   class="radio-inline  "  name="gender" id="gender1" value="1" checked > 男
			  </label>
			  <label>
			    <input type="radio"    class="radio-inline  "  name="gender" id="gender2" value="2" checked> 女
			  </label>
			  </div>
			  </div>
			
			<div class="input-group">
			  <span class="input-group-addon">爱好:</span>
			  <input name="hobby" type="text" class="form-control" data-rule="required;username"><br />
			</div>
			<input class="btn  btn-sm btn-primary btn-block" type="submit" id="register" value="提交">
			</form>
</div>	

<script>
	    	function selectCode(obj){
	    		var valueCode = document.getElementById("addcode").value
	    		
	    		if(valueCode!=null && valueCode!="" ){
	    		$.get('<%=request.getContextPath()%>/TalentServlet?command=selectCode&valueCode='+valueCode+'&time=' + new Date().getTime(), function(text){
				     // 如果是成功了就在页面上删除当前a标签所在的tr，如果不成功给出提示
				     if (text == 'no') {
				    	layer.msg('账号已存在!', {time: 2000, icon: 5});
				    	document.getElementById("register").disabled=true;
				     } else if(text =='yes') {
				    	layer.msg('该账号可以使用!', {time: 2000, icon: 6});
				    	document.getElementById("register").disabled=false;
				     }
				  });
	    		}else{
	    			layer.msg('账号不能为空!', {time: 2000, icon: 5});
	    		}
	    	}
	    
	    </script>
		
</body>
</html>